var Board = function()
{
    this.pieceByLocation = ["e", "e", "e", "e", "e", "e", "e", "e", "e"];
    this.devIndWidth = 3;
    this.devIndheight = 3;
}

Board.prototype.getWidth = function()
{
    return this.devIndWidth;    
}

Board.prototype.getHeight = function()
{
    return this.devIndheight;    
}

Board.prototype.initialize = function()
{
    this.pieceByLocation = ["e", "e", "e", "e", "e", "e", "e", "e", "e"];    
}

Board.prototype.reInitialize = function()
{
    this.initialize();    
}

Board.prototype.isLocationOccupied = function(aLocation)
{
    var isOccupied = ( this.pieceByLocation[aLocation.getLocation() - 1] !== "e" );
    return isOccupied;
}

Board.prototype.getPieceByLocation = function(aLocation)
{
    return this.pieceByLocation[aLocation.getLocation() - 1];
}

Board.prototype.makeMove = function(_move)
{
    var player = _move.getPlayer();
    var location = _move.getLocation();
    this.pieceByLocation[location.getLocation() - 1] = player.getType();
}

Board.prototype.undoMove = function(_move)
{
    var player = _move.getPlayer();
    var piece = new ttt_piece();
    
    var location = _move.getLocation();
    piece.setType(player.getType());
    piece.setLocation(location);
    this.pieceByLocation[location] = null;
}